package com.lagou.service.impl;

import com.lagou.service.HomeWorkService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Random;

/**
 * @Author: zhangzhiwei
 * @Date: 2022/3/13 12:59
 */
@Service
public class HomeWorkServiceImpl implements HomeWorkService {

    private static final Random random = new Random();

    private static final Logger log = LoggerFactory.getLogger(HomeWorkServiceImpl.class);

    @Override
    public void methodA() {
        int i = random.nextInt(101);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            log.error("MethodA Exception...", e);
        }
    }

    @Override
    public void methodB() {
        int i = random.nextInt(101);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            log.error("MethodB Exception...", e);
        }
    }

    @Override
    public void methodC() {
        int i = random.nextInt(101);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            log.error("MethodC Exception...", e);
        }
    }
}
